//////////////////////////////////////////////////////////////////////////////////////////
/// \file     chain_node_singleton.h
/// \brief    ros2对外通信的数据传递.
///
/// \version  V1.0
/// \author   xhome
/// \date     2020/6/9 上午10:07
//////////////////////////////////////////////////////////////////////////////////////////

#ifndef ROS2_CHAIN_INTERFACE_CHAIN_NODE_SINGLETON_H
#define ROS2_CHAIN_INTERFACE_CHAIN_NODE_SINGLETON_H

#include <iostream>
#include <mutex>
#include <memory>

using namespace std;

class ChainNodeSingleton {
public:
    static shared_ptr<ChainNodeSingleton>  get_instance()
    {
        if( s_instance_ == nullptr)
        {
            s_instance_.reset(new ChainNodeSingleton);
        }

        return s_instance_;
    }

public:
     static shared_ptr<ChainNodeSingleton> s_instance_;
     char buffer[10240];

private:
    ChainNodeSingleton(){};
};

shared_ptr<ChainNodeSingleton> ChainNodeSingleton::s_instance_;

#endif //ROS2_CHAIN_INTERFACE_CHAIN_NODE_SINGLETON_H
